//
//  BN_AgreementViewController.m
//  BabyNow
//
//  Created by 刘泽琛 on 14-7-18.
//  Copyright (c) 2014年 iMobile. All rights reserved.
//

#import "BN_AgreementViewController.h"
#import "BN_UseAgreementView.h"

@interface BN_AgreementViewController () {
    BN_UseAgreementView *useAgreementView;
}

@end

@implementation BN_AgreementViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    if (IOS7) {
        self.automaticallyAdjustsScrollViewInsets = NO;
    }
    self.title = @"使用协议";
    UIBarButtonItem *leftItem = [[UIBarButtonItem alloc]initWithImage:[UIImage imageNamed:@"houtui"] style:UIBarButtonItemStylePlain target:self action:@selector(backRootVC)];
    self.navigationItem.leftBarButtonItem = leftItem;
    self.view.backgroundColor = APP_OBJECT_GRAY_COLOR;
    useAgreementView = [[[NSBundle mainBundle]loadNibNamed:@"BN_UseAgreementView" owner:nil options:nil]objectAtIndex:0];
    [useAgreementView setDecelerationRate:0.1];
    switch (MAIN_VERSION) {
        case 6:
            useAgreementView.frame = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT-44);
            break;
        default:
            useAgreementView.frame = CGRectMake(0, 44, SCREEN_WIDTH, FULLSCREEN_HEIGHT-44);
            break;
    }
    useAgreementView.backgroundColor = [UIColor whiteColor];
    [useAgreementView loadHintView];
    [self.view addSubview:useAgreementView];
    [UIView animateWithDuration:1 animations:^{
    } completion:^(BOOL finished) {
        // code...
    }];
}

- (void)backRootVC {
    [self.navigationController popViewControllerAnimated:YES];
}

@end
